// eslint-disable-next-line no-extend-native
Date.prototype.getCurrentMonthDays = function () {
  //获取当前月有多少天
  let tempDate = new Date("2000-01-01");
  tempDate.setFullYear(this.getFullYear()); //2023
  tempDate.setMonth(this.getMonth() + 1); //5
  tempDate.setDate(0); //从5月1号 变成了4月30
  return tempDate.getDate(); //30
};
// eslint-disable-next-line no-extend-native
Date.prototype.getPrevMonthDays = function () {
  //获取上个月多少天
  let tempDate = new Date("2000-01-01");
  tempDate.setFullYear(this.getFullYear()); //2023
  tempDate.setMonth(this.getMonth()); //
  tempDate.setDate(0); //
  return tempDate.getDate(); //
};
// eslint-disable-next-line no-extend-native
Date.prototype.getCurrentMonthFirstDayWeek = function () {
  //别用箭头函数
  let tempDate = new Date("2000-01-01");
  tempDate.setFullYear(this.getFullYear()); //2023
  tempDate.setMonth(this.getMonth()); //4
  return tempDate.getDay(); //获取是星期几
};

// eslint-disable-next-line no-extend-native
Date.prototype.formate = function (str) {
  //格式化时间
  let year = this.getFullYear();
  let month = this.getMonth()+1;
  let day = this.getDate();

  return str.replace("yyyy", year).replace("mm", month).replace("dd", day);
};

// let date = new Date();
// date.formate("yyyy年mm月dd"); //2023年4月3


// eslint-disable-next-line no-extend-native
Date.prototype.getJQ = function(){
  //yyyy  mm   dd
  let  yyyy  = this.getFullYear();
  let  mm  = this.getMonth()+1;
  let dd  = this.getDate();
  mm = mm-1;
  var sTermInfo = new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758);
  var solarTerm = new Array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至");
  var tmp1 = new Date((31556925974.7*(yyyy-1900)+sTermInfo[mm*2+1]*60000)+Date.UTC(1900,0,6,2,5));
  var tmp2 = tmp1.getUTCDate();
  var solarTerms = "";
  if (tmp2==dd)
      solarTerms = solarTerm[mm*2+1];
  tmp1 = new Date((31556925974.7*(yyyy-1900)+sTermInfo[mm*2]*60000)+Date.UTC(1900,0,6,2,5));
  tmp2= tmp1.getUTCDate();
  if (tmp2==dd) 
      solarTerms = solarTerm[mm*2];
  return solarTerms;

}
